package com.example.javaproject;

import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;

public class CacheBean<T>/* extends BaseCacheModel<T>*/ {
    T type;

    public CacheBean(  String fileName) {
    }

    public void showType() {
        System.out.println();
    }

    public void doSomething() {
        Type genericSuperclass = getClass().getGenericSuperclass();
        if (genericSuperclass instanceof ParameterizedType) {
            Type[] actualTypeArguments = ((ParameterizedType) genericSuperclass).getActualTypeArguments();
            System.out.println(actualTypeArguments[0].toString());
        } else {
            System.out.println(" object " + genericSuperclass.toString());
        }
        System.out.println();
    }
}
